package com.ruoyi.project.orderWorks.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.orderWorks.mapper.OrderWorksMapper;
import com.ruoyi.project.orderWorks.domain.OrderWorks;
import com.ruoyi.project.orderWorks.service.IOrderWorksService;

/**
 * 订单操作记录Service业务层处理
 * 
 * @author wyh
 * @date 2024-09-11
 */
@Service
public class OrderWorksServiceImpl implements IOrderWorksService 
{
    @Autowired
    private OrderWorksMapper orderWorksMapper;

    /**
     * 查询订单操作记录
     * 
     * @param id 订单操作记录主键
     * @return 订单操作记录
     */
    @Override
    public OrderWorks selectOrderWorksById(Long id)
    {
        return orderWorksMapper.selectOrderWorksById(id);
    }

    /**
     * 查询订单操作记录列表
     * 
     * @param orderWorks 订单操作记录
     * @return 订单操作记录
     */
    @Override
    public List<OrderWorks> selectOrderWorksList(OrderWorks orderWorks)
    {
        return orderWorksMapper.selectOrderWorksList(orderWorks);
    }

    /**
     * 新增订单操作记录
     * 
     * @param orderWorks 订单操作记录
     * @return 结果
     */
    @Override
    public int insertOrderWorks(OrderWorks orderWorks)
    {
        orderWorks.setCreateTime(DateUtils.getNowDate());
        return orderWorksMapper.insertOrderWorks(orderWorks);
    }

    /**
     * 修改订单操作记录
     * 
     * @param orderWorks 订单操作记录
     * @return 结果
     */
    @Override
    public int updateOrderWorks(OrderWorks orderWorks)
    {
        orderWorks.setUpdateTime(DateUtils.getNowDate());
        return orderWorksMapper.updateOrderWorks(orderWorks);
    }

    /**
     * 批量删除订单操作记录
     * 
     * @param ids 需要删除的订单操作记录主键
     * @return 结果
     */
    @Override
    public int deleteOrderWorksByIds(Long[] ids)
    {
        return orderWorksMapper.deleteOrderWorksByIds(ids);
    }

    /**
     * 删除订单操作记录信息
     * 
     * @param id 订单操作记录主键
     * @return 结果
     */
    @Override
    public int deleteOrderWorksById(Long id)
    {
        return orderWorksMapper.deleteOrderWorksById(id);
    }
}
